#include "message_flow.h"

#ifndef POINT_READ_WRITE
#define POINT_READ_WRITE


#define PRIORITY_ARR_LEN 16

typedef struct priority_data
{
    UINT8 	used;		//0未使用  ，1使用中
    double 	value;
}priority_data_t;

typedef struct point_data
{
    int 				obj_id;
    UINT8 				max_priority;	//当前最大优先级。1-16级别递减
    priority_data_t 	priority_arr[PRIORITY_ARR_LEN];
	int					data_type;
    flow_node_base_t 	*node;
    struct point_data 	*next_point;
    int (*write_point_callback)(int, int, double, struct point_data *p);
} point_data_t;

point_data_t *vav_add_point(int obj_id, flow_node_base_t *node, int (*write_point_callback)(int, int, double, point_data_t *p));

void vav_clear_points();

point_data_t *vav_get_point_by_id(int obj_id);


void vav_remove_priority(int obj_id, int arr_index);

void vav_set_point_msg(int obj_id, double value);

void process_point_rw(uint8_t vc, char *data, int len, uint16_t rsp_cmd);

UINT8 vav_get_point_priority_by_stype(char *sensor_type);

int vav_set_msg_to_priority(int obj_id, double value, int priority);

int vav_get_msg_to_priority(int obj_id, double *value, int *priority, char *stype);
int vav_set_msg_to_priority(int obj_id, double value, int priority);

#endif
